<template>
	<view class="">
		<cu-custom bgColor="bg-red" :isBack="true">
			<block slot="backText">返回</block>
			<block slot="content">{{title}}</block>
		
		</cu-custom>
		
		<view class="cu-list menu   sm-border bg-whtie">
			<view class=" text-xs padding bg-white">
				<text class="text-xs">转充金额</text>
			</view>
		
			<view class="cu-form-group  solid-bottom">
				
				<text class="text-xl">￥</text><input placeholder="" name="input" v-model="postData.money"></input>
			</view>

			<view class=" text-xs padding bg-white flex justify-between">
				<text class="text-sm">可用余额{{userinfo.money}}元</text>
				<view class="text-blue" @click="allRecharing">全部转充</view>
			</view>
		</view>
		<view class=" text-xs padding-sm">
			<text class="text-sm text-red">1.转充会款大于100元享受优逼
</text>
		</view>
		
		<view class="padding flex flex-direction" @click="sumbit">
			<button class="cu-btn bg-red margin-tb-sm lg">确认转充</button>
		</view>
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: "转充",
				postData:{
					money:0
				},
				userinfo:{
					money:10
				}
				
	
	
			}
	
		},
		methods:{
			allRecharing(){
			   (this.userinfo.money!=0)?(()=>{
				   this.postData.money=this.userinfo.money;
			   })():(()=>{
				   this.$Reques.showToast("没有可用的余额");
			   })();
			},
			sumbit(){
				
				let confirm=()=>{
					this.$Reques.request(this.$Reques.interface_url.recharging, "POST", this.postData).then((res) => {
						this.$Reques.showToast(res.message);
						if (res.status == 200) {
							
							
						}
					})
				}
				(this.postData.money!=0)?confirm():(()=>{
					
					this.$Reques.showToast("请输入转充的金额");
				})();
				
				
				
			}
			
			
			
		}
		
	
	
	
	
	}
	
</script>

<style>
</style>
